import request from './request'

/**
 * 轮播图接口
 */
export function getbanner () {
  return request({
    url: '/banner',
    method: 'get'
  })
}

/**
 * 请求nav导航的接口
 */
export function getnav () {
  return request({
    url: '/nav',
    method: 'get'
  })
}

/**
 * 请求主页分类数据
 */
export function getHomepageCategoryList () {
  return request({
    url: '/HomepageCategory',
    method: 'get'
  })
}

/**
 * 获取主页分类当前分类下的数据
 * @param {object} params { title: '' }
 */
export function GetTypeHomepageCategoryData (params) {
  return request({
    url: '/HomepageCategory/GetTypeHomepageCategoryData',
    method: 'get',
    params
  })
}

/**
 * 详情页数据接口 detail
 */
export function getDetailList (params) {
  return request({
    url: '/pro/detail',
    method: 'get',
    params
  })
}
/**
 * kind页分类数据接口
 */
export function getKindList (params) {
  return request({
    url: '/category/GetTypeCategoryData',
    method: 'get',
    params
  })
}
/**
 * kind页全部数据接口
 */
export function getKindAllList (params) {
  return request({
    url: '/pro/AllPros',
    method: 'get',
    params
  })
}
/**
 * register页注册接口
 */
export function register (params) {
  return request({
    url: '/users/register',
    method: 'post',
    data: params
  })
}
/**
 * login页登录接口
 */
export function login (params) {
  return request({
    url: '/users/login',
    method: 'post',
    data: params
  })
}
/**
 * search页搜索接口
 */
export function search (params) {
  return request({
    url: '/search',
    method: 'get',
    params
  })
}
/**
 * 为你推荐接口
 */
export function getProList (params) {
  return request({
    url: '/pro',
    method: 'get',
    params
  })
}
/**
 * 获取当前用户的信息
 */
export function getUserInfo (params) {
  return request({
    url: '/users/getuserinfo',
    method: 'get',
    params
  })
}
/**
 * 修改用户信息
 */
export function updateInfo (params) {
  return request({
    url: '/users/updateinfo',
    method: 'post',
    data: params
  })
}
/**
 * 注销用户信息
 */
export function logoutMsg (params) {
  return request({
    url: '/users/Cancellation',
    method: 'post',
    data: params
  })
}
/**
 * 加入购物车
 */
export function getCart (params) {
  return request({
    url: '/cart/add',
    method: 'post',
    data: params
  })
}
/**
 * 查看购物车数据
 */
export function getCartList (params) {
  return request({
    url: '/cart',
    method: 'get',
    params
  })
}
/**
 * 删除购物车数据
 */
export function removeCartList (params) {
  return request({
    url: '/cart/delete',
    method: 'get',
    params
  })
}
/**
 * 生成订单接口
 */
export function addOrderList (params) {
  return request({
    url: '/order/add',
    method: 'post',
    data: params
  })
}
/**
 * 添加地址
 */
export function addAddress (params) {
  return request({
    url: '/address/add',
    method: 'post',
    data: params
  })
}
/**
 * 删除地址接口
 */
export function removeAddress (params) {
  return request({
    url: '/address/DelAddress',
    method: 'post',
    data: params
  })
}
/**
 * 修改地址接口
 */
export function updataAddress (params) {
  return request({
    url: '/address/UpdataAddress',
    method: 'post',
    data: params
  })
}
/**
 * 获取地址列表
 */
export function getAddressData (params) {
  return request({
    url: '/address',
    method: 'get',
    params
  })
}
/**
 * 修改订单的收货人信息
 */
export function updateOrderAddress (params) {
  return request({
    url: '/order/updateAddress',
    method: 'get',
    params
  })
}
/**
 * 获取全部订单接口
 */
export function getOrderList (params) {
  return request({
    url: 'order/LookOrder',
    method: 'get',
    params
  })
}
/**
 * 获取订单详情接口
 */
export function getOrderDetailsList (params) {
  return request({
    url: '/order',
    method: 'get',
    params
  })
}
/**
 * 实名购票人接口
 */
export function realName (params) {
  return request({
    url: '/users/updateIdCard',
    method: 'post',
    data: params
  })
}
/**
 * 短信验证码接口
 */
export function sendCode (params) {
  return request({
    url: '/users/sendCode',
    method: 'post',
    data: params
  })
}
/**
 * 更改密码接口
 */
export function updataPassword (params) {
  return request({
    url: '/users/updatepwd',
    method: 'post',
    data: params
  })
}
/**
 * 更新用户头像接口
 */
export function updateAvatar (params) {
  return request({
    url: '/users/updateAvatar',
    method: 'post',
    data: params
  })
}
